const express = require('express');
const { authenticateToken } = require('../middleware/auth');
const StudentCourseController = require('../controllers/student/CourseController');

const router = express.Router();

// 课程相关路由
router.get('/courses', authenticateToken, StudentCourseController.index);
router.get('/courses/recommend', authenticateToken, StudentCourseController.recommend);
router.get('/courses/hot', authenticateToken, StudentCourseController.hot);
router.get('/courses/free', authenticateToken, StudentCourseController.free);
router.get('/courses/search', authenticateToken, StudentCourseController.search);
router.get('/courses/:id', authenticateToken, StudentCourseController.show);
router.post('/courses/purchase', authenticateToken, StudentCourseController.purchase);
router.get('/my-courses', authenticateToken, StudentCourseController.myCourses);

// 仪表板
router.get('/dashboard', authenticateToken, (req, res) => {
  res.json({ code: 0, message: '学生仪表板', data: {} });
});

module.exports = router; 